/*
 * Header file for the MLE application
 * Salem Machaka
 * 04/03/98
 */
 

#ifndef MLE
#define MLE


#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>
#include<float.h>



/*
 * Global Variable Declaration
 */
double	INIT_TEMP;
int	ITER;
int	SUCC;
double	FACTOR;
double	CRITERIA_CONJ;
double	CRITERIA_BISECTION;
FILE	*OUT, *LOG;
int	NUMB_ITER_LOG;
int	SEED;


/*
 * Function declaration
 */
double 	Min(double, double);
int 	Indicator(double, double);
int 	*Int_Vector(int, int);
double	*Dec_Vector(int, int);
void 	Free_Int(int *, int);
void 	Free_Dec(double *, int);
int 	**Int_Matrix(int, int, int, int);
double	**Dec_Matrix(int, int, int, int);
void 	Free_Matrix(void **, int, int, int);
void Free_Intmatrix(int **mat, int begrow, int endrow, int begcol);

void 	Abort(char *);
void	Read_Files(int*, int*, int*, int*, int ***, int **, 
		   double*, double*, int *, int, char **);
void	Initial_Param(int***, double***, int*, double*, double **, 
		      int, int, int, int, int**, double, 
		      double, int);
void 	Initial_Ys(int *, double *, int, int, int ,
		   int, int **);
void 	Get_R(double *, int, int, int, int, double **, int *);
double 	Func(double, double *, double **, double *, int, int, 
		int, int *);
void 	Gradient(double *, double *, double **, double *, 
                int, int, int, int *);
void 	Reverse( int *, int);
void 	AnnealJoint(struct PhysicalData *pData,double percent,int ch_id);
void 	AnnealPhysical(struct PhysicalData *pData,double percent,int ch_id);
void    Anneal(struct PhysicalData *pData,int ch_id);
void 	Bracket(double *, double *, double *, double *, int, int);
void 	Line_Minimize(double, double, double *, double *, int, int, 
		double **, int *, int, double, double *);
double 	Gradient_S(double *, double *, int, int, double **, 
			int *, int, double *);
double 	Conj(double *, int, int, double **, int *r, int, double, 
		double *);
void 	Project(double *, double *, int, int);
void 	Print_Results(int *, double *, int, double);



#endif
